import request from '@/utils/request'

// 获取员工的简单列表
export const getEmployeeSimple = () => request.get('/sys/user/simple')

// 获取员工的列表
export const getEmployeeList = params => request.get('/sys/user', { params })

// 删除员工
export const delEmplpyee = id => request.delete(`/sys/user/${id}`)

// 新增员工
export const addEmplpyee = data => request.post('/sys/user',data)

// 导入员工
export const importEmployee = data => request.post('/sys/user/batch',data)

// 保存员工的基本信息
export const saveUserDetailById = data => request.put(`/sys/user/${data.id}`, data)

// 读取用户详情的基础信息
export const getPersonalDetail = id => request.get(`/employees/${id}/personalInfo`)

// 更新用户详情的基础信息
export const updatePersonal = data => request.put(`/employees/${data.userId}/personalInfo`, data)

// 获取用户的岗位信息
export const getJobDetail = id => request.get(`/employees/${id}/jobs`)

// 保存岗位信息
export const updateJob = data => request.put( `/employees/${data.userId}/jobs`, data)

// 给员工分配角色
export const assignRoles = data => request.put('/sys/user/assignRoles', data)